Skip to content

[breaking] legacy: refactoring of the old Logger (part 1 of 2) #1621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 11, 2022

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Jan 11, 2022

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)

What kind of change does this PR introduce?

  • Cleanup of barely used methods of legacy Logger: Logger.UnformattedWrite, Logger.UnformattedFprintln, Logger.Name, Logger.Flush
  • Progress reports of the compilation are now handled via rpc.TaskProgressCB
  • Fixed some minor bugs.

What is the current behavior?
No changes in behavior.

What is the new behavior?
No changes in behavior.

Does this PR introduce a breaking change, and is titled accordingly?
A new argument progressCB has been added to commands.Compile, the new function signature is:

func Compile(
	ctx context.Context,
	req *rpc.CompileRequest,
	outStream, errStream io.Writer,
	progressCB commands.TaskProgressCB,
	debug bool
) (r *rpc.CompileResponse, e error) {

if a callback function is provided the Compile command will call it periodically with progress reports
with the percentage of compile completed otherwise, if the parameter is nil, no progress reports will be performed.

Other information:
This PR is the basis for a bigger refactoring aimed to remove the legacy i18n.Logger (#1623).

@cmaglie cmaglie requested a review from silvanocerza January 11, 2022 11:09
@cmaglie cmaglie force-pushed the some_legacy_refactoring branch from 4388002 to 48f0235 Compare January 11, 2022 17:00
@cmaglie cmaglie changed the title legacy: refactoring of the old Logger (part 1 of 2) [breaking] legacy: refactoring of the old Logger (part 1 of 2) Jan 11, 2022
@cmaglie cmaglie merged commit edc63f8 into arduino:master Jan 11, 2022
@cmaglie cmaglie deleted the some_legacy_refactoring branch January 11, 2022 21:11
@per1234 per1234 added the topic: code Related to content of the project itself label Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants